﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GmModelFamily.h"
#include "OwnerPtr.h"
#include "ElementId.h"

namespace gcmp
{
    class IDocument;
    class UniIdentity;
}

namespace gfam
{
    class GCMP_MODEL_FAMILY_EXPORT FamilyModelViewVisibilityFilterUtils
    {
    public:
        /// \brief 为显示过滤器增加过滤的Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \return true添加成功，false添加失败
        static bool AddCategoryToFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid);

        /// \brief 为显示过滤器增加过滤的Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \param subClassGuid 子类Guid
        /// \return true添加成功，false添加失败
        static bool AddCategoryToFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid, const std::wstring& subClassGuid);

        /// \brief 为显示过滤器移除过滤的Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \return true移除成功，false移除失败
        static bool RemoveCategoryFromFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid);

        /// \brief 为显示过滤器移除过滤的Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \param subClassGuid 子类Guid
        /// \return true移除成功，false移除失败
        static bool RemoveCategoryFromFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid, const std::wstring& subClassGuid);

        /// \brief 检查显示过滤器是否过滤了某个Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \return true过滤了指定的Category，false没有过滤指定的Category
        static bool IsCategoryExistInFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid);

        /// \brief 检查显示过滤器是否过滤了某个Category
        /// \param pDoc 文档
        /// \param modelViewId 模型视图id
        /// \param uid category uid
        /// \param subClassGuid 子类Guid
        /// \return true过滤了指定的Category，false没有过滤指定的Category
        static bool IsCategoryExistInFilter(gcmp::IDocument* pDoc, const gcmp::ElementId& modelViewId, const gcmp::UniIdentity& uid, const std::wstring& subClassGuid);
    };
}

